package jgl.vajra.kingkong.part.vehicle.viewModel;

import java.util.Map;

import jgl.vajra.kingkong.bean.OwnerDetailsBean;
import jgl.vajra.kingkong.part.vehicle.contract.OwnerDetailsContract;
import jgl.vajra.kingkong.part.vehicle.model.OwnerDetailsModel;
import jgl.vajra.kingkong.widget.mvvm.factory.CreateModel;
import jgl.vajra.kingkong.widget.retrofithelper.rxsubscriber.ProgressObserver;

@CreateModel(OwnerDetailsModel.class)
public class OwnerDetailsViewModel extends OwnerDetailsContract.ViewModel{
    @Override
    public void getOwnerDetailsData(Map<String, Object> map) {
        mModel.getOwnerDetailsData(map).subscribe(new ProgressObserver<OwnerDetailsBean>(true,this) {
            @Override
            public void _onNext(OwnerDetailsBean data) {
                mView.returnOwnerDetailsData(data);
            }

            @Override
            public void _onError(String errorMessage, int errorCode) {
                super._onError(errorMessage, errorCode);
            }
        });
    }
}
